home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!olivea!oliveb!veritas!amdcad!sun!exodus!opal.cs.tu-berlin.de
- From: phade@opal.cs.tu-berlin.de (Frank Gadegast)
- Newsgroups: comp.sources.x
- Subject: v13i076: X Font Browser, Part01/02
- Message-ID: <csx-13i076-font-browser@uunet.UU.NET>
- Date: 6 Jul 91 07:12:41 GMT
- Sender: news@exodus.Eng.Sun.COM
- Lines: 972
- Approved: argv@sun.com
-
- Submitted-by: phade@opal.cs.tu-berlin.de (Frank Gadegast)
- Posting-number: Volume 13, Issue 76
- Archive-name: font-browser/part01
-
-
- So, this is now the X11-font-browser, latest edition.
- (With Imakefile and in shar-format. Thanks for the Imake-help to Dan Heller).
-
- ------------------------------cut here-------------------------------
- #!/bin/sh
- # This is a shell archive (produced by shar 3.49)
- # To extract the files from this archive, save it to a file, remove
- # everything above the "!/bin/sh" line above, and type "sh file_name".
- #
- # made 07/01/1991 09:35 UTC by phade@trick
- # Source directory /tmp_mnt/home/all/phade/SRC/Phade/xfb
- #
- # existing files will NOT be overwritten unless -c is specified
- #
- # This shar contains:
- # length mode name
- # ------ ---------- ------------------------------------------
- # 2015 -rw-r--r-- README
- # 10759 -rw-r--r-- Makefile
- # 1120 -rw-r--r-- Makefile.mk
- # 679 -rw------- Imakefile
- # 151 -rw-r--r-- XFBROWS.AD
- # 1371 -rw-r--r-- bitmaps.h
- # 4110 -rw-r--r-- xfbrows.h
- # 2132 -rw-r--r-- xfbrows.man
- #
- # ============= README ==============
- if test -f 'README' -a X"$1" != X"-c"; then
- echo 'x - skipping README (File already exists)'
- else
- echo 'x - extracting README (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'README' &&
- X
- X XFBROWS
- X =====================
- X
- This is a very nice font-browser under X11.
- Why should we still use xlsfont and xfd ?
- X
- It should work under nearly every system, 'cause it's programed without
- MOTIF, the X11-Toolit or other stupid things (like widgets, that you only
- can find somewhere in CHINA and that only run under Release 2. That happened
- once to me !!!), that are always causing problems. It only needs the
- XX11-library, no matter if you're using Release 3 or Release 4.
- X
- In addition it has some defines to let it run under BSD, SYSV, A/UX
- or XENIX and you don't have to hack a difficult Imake- or Make-file (I
- will never understand why people add horible Imake- or Make-files, if
- they only have to compile a few files and link them then together). And
- you will not have trouble with crazy pathnames !!!
- X
- X
- Compilation:
- ============
- X
- Select the right defines for your system and edit the Makefile.
- Select
- X
- X -Di386 , if running on a Intel 386
- X -DSVR4 , if you running a System-V-Unix
- X -DSCO , if you running a SCO-Xenix-Unix
- X
- X -DNOTIMER , if you have problems with timers
- X -DUSLEPP , if you have of a uslepp-call
- X
- If you're running a INTERACTIVE-Unix be shure you link with the inet-library.
- X
- Have a look into the Makefile to see what's right and then just enter
- X
- X make
- X
- X
- Installation:
- =============
- X
- Just copy the resulting file XFBROWS whereever you like too.
- Make the man-page by typing
- X
- X nroff -man xfbrows.man > xfbrows.1
- X
- and copy it whereever you will need it.
- X
- X
- Comments:
- =========
- X
- If you get problems (not really possible) to compile it or if you have
- comments send them to
- X
- X phade@cs.tu-berlin.de
- X
- This tool is specialy made to include it in other utilities (I hate it,
- if you have to specify fontnames by typing them in, that should not
- happen in X11-applications), so if you do it, please send you're programs
- to me. Thank's a lot !!!
- X
- The source-code is edited with Tab-Space 4. If you like to hack around in
- the source-code, do so. I don't care, if you get problems.
- X
- X Have fun :-)
- X
- SHAR_EOF
- chmod 0644 README ||
- echo 'restore of README failed'
- Wc_c="`wc -c < 'README'`"
- test 2015 -eq "$Wc_c" ||
- echo 'README: original size 2015, current size' "$Wc_c"
- fi
- # ============= Makefile ==============
- if test -f 'Makefile' -a X"$1" != X"-c"; then
- echo 'x - skipping Makefile (File already exists)'
- else
- echo 'x - extracting Makefile (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'Makefile' &&
- # Makefile generated by imake - do not edit!
- # $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
- #
- # The cpp used on this machine replaces all newlines and multiple tabs and
- # spaces in a macro expansion with a single space. Imake tries to compensate
- # for this, but is not always successful.
- #
- X
- ###########################################################################
- # Makefile generated from "Imake.tmpl" and </tmp/IIf.a02039>
- # $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
- #
- # Platform-specific parameters may be set in the appropriate .cf
- # configuration files. Site-wide parameters may be set in the file
- # site.def. Full rebuilds are recommended if any parameters are changed.
- #
- # If your C preprocessor doesn't define any unique symbols, you'll need
- # to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
- # "make Makefile", "make Makefiles", or "make World").
- #
- # If you absolutely can't get imake to work, you'll need to set the
- # variables at the top of each Makefile as well as the dependencies at the
- # bottom (makedepend will do this automatically).
- #
- X
- ###########################################################################
- # platform-specific configuration parameters - edit sun.cf to change
- X
- SYSLIBS=-lXt -lX11
- MWM_DEFINES=-DSHAPE -DOPAQUE
- X
- # platform: $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
- # operating system: SunOS 4.0.3
- X
- ###########################################################################
- # site-specific configuration parameters - edit site.def to change
- X
- # site: $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
- X
- X SHELL = /bin/sh
- X
- X TOP = /home/X11R4/mit
- X CURRENT_DIR = /home/all/phade/SRC/Phade/xfb
- X
- X AR = ar cq
- X BOOTSTRAPCFLAGS =
- X CC = cc
- X
- X COMPRESS = compress
- X CPP = /lib/cpp $(STD_CPP_DEFINES)
- X PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
- X INSTALL = install
- X LD = ld
- X LINT = lint
- X LINTLIBFLAG = -C
- X LINTOPTS = -axz
- X LN = ln -s
- X MAKE = make
- X MV = mv
- X CP = cp
- X RANLIB = ranlib
- X RANLIBINSTFLAGS =
- X RM = rm -f
- X STD_INCLUDES =
- X STD_CPP_DEFINES =
- X STD_DEFINES =
- X EXTRA_LOAD_FLAGS =
- X EXTRA_LIBRARIES =
- X TAGS = ctags
- X
- X SHAREDCODEDEF = -DSHAREDCODE
- X SHLIBDEF = -DSUNSHLIB
- X
- X PROTO_DEFINES =
- X
- X INSTPGMFLAGS =
- X
- X INSTBINFLAGS = -m 0755
- X INSTUIDFLAGS = -m 4755
- X INSTLIBFLAGS = -m 0664
- X INSTINCFLAGS = -m 0444
- X INSTMANFLAGS = -m 0444
- X INSTDATFLAGS = -m 0444
- X INSTKMEMFLAGS = -m 4755
- X
- X DESTDIR =
- X
- X TOP_INCLUDES = -I$(TOP)
- X
- X CDEBUGFLAGS = -O
- X CCOPTIONS = -D_NO_PROTO -DSTRINGS_ALIGNED -DNO_REGEX -DNO_ISDIR -DUSE_RE_COMP -DUSE_GETWD
- X COMPATFLAGS =
- X
- X ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
- X ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
- X CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
- X LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
- X LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
- X LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
- X LDCOMBINEFLAGS = -X -r
- X
- X MACROFILE = sun.cf
- X RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
- X
- X IMAKE_DEFINES =
- X
- X IRULESRC = $(CONFIGSRC)
- X IMAKE_CMD = $(NEWTOP)$(IMAKE) -I$(NEWTOP)$(IRULESRC) $(IMAKE_DEFINES)
- X
- X ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
- X $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
- X $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
- X
- ###########################################################################
- # X Window System Build Parameters
- # $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
- X
- ###########################################################################
- # X Window System make variables; this need to be coordinated with rules
- # $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
- X
- X PATHSEP = /
- X USRLIBDIR = $(DESTDIR)/usr/lib
- X BINDIR = $(DESTDIR)/usr/bin/X11
- X INCROOT = $(DESTDIR)/usr/include
- X BUILDINCROOT = $(TOP)
- X BUILDINCDIR = $(BUILDINCROOT)/X11
- X BUILDINCTOP = ..
- X INCDIR = $(INCROOT)/X11
- X ADMDIR = $(DESTDIR)/usr/adm
- X LIBDIR = $(USRLIBDIR)/X11
- X CONFIGDIR = $(LIBDIR)/config
- X LINTLIBDIR = $(USRLIBDIR)/lint
- X
- X FONTDIR = $(LIBDIR)/fonts
- X XINITDIR = $(LIBDIR)/xinit
- X XDMDIR = $(LIBDIR)/xdm
- X AWMDIR = $(LIBDIR)/awm
- X TWMDIR = $(LIBDIR)/twm
- X GWMDIR = $(LIBDIR)/gwm
- X MANPATH = $(DESTDIR)/usr/man
- X MANSOURCEPATH = $(MANPATH)/man
- X MANDIR = $(MANSOURCEPATH)n
- X LIBMANDIR = $(MANSOURCEPATH)3
- X XAPPLOADDIR = $(LIBDIR)/app-defaults
- X
- X SOXLIBREV = 4.2
- X SOXTREV = 4.0
- X SOXAWREV = 4.0
- X SOOLDXREV = 4.0
- X SOXMUREV = 4.0
- X SOXEXTREV = 4.0
- X
- X FONTCFLAGS = -t
- X
- X INSTAPPFLAGS = $(INSTDATFLAGS)
- X
- X IMAKE = $(IMAKESRC)/imake
- X DEPEND = $(DEPENDSRC)/makedepend
- X RGB = $(RGBSRC)/rgb
- X FONTC = $(BDFTOSNFSRC)/bdftosnf
- X MKFONTDIR = $(MKFONTDIRSRC)/mkfontdir
- X MKDIRHIER = /bin/sh $(SCRIPTSRC)/mkdirhier.sh
- X
- X CONFIGSRC = $(TOP)/config
- X CLIENTSRC = $(TOP)/clients
- X DEMOSRC = $(TOP)/demos
- X LIBSRC = $(TOP)/lib
- X FONTSRC = $(TOP)/fonts
- X INCLUDESRC = $(TOP)/X11
- X SERVERSRC = $(TOP)/server
- X UTILSRC = $(TOP)/util
- X SCRIPTSRC = $(UTILSRC)/scripts
- X EXAMPLESRC = $(TOP)/examples
- X CONTRIBSRC = $(TOP)/../contrib
- X DOCSRC = $(TOP)/doc
- X RGBSRC = $(TOP)/rgb
- X DEPENDSRC = $(UTILSRC)/makedepend
- X IMAKESRC = $(CONFIGSRC)
- X XAUTHSRC = $(LIBSRC)/Xau
- X XLIBSRC = $(LIBSRC)/X
- X XMUSRC = $(LIBSRC)/Xmu
- X TOOLKITSRC = $(LIBSRC)/Xt
- X AWIDGETSRC = $(LIBSRC)/Xaw
- X OLDXLIBSRC = $(LIBSRC)/oldX
- X XDMCPLIBSRC = $(LIBSRC)/Xdmcp
- X BDFTOSNFSRC = $(FONTSRC)/bdftosnf
- X MKFONTDIRSRC = $(FONTSRC)/mkfontdir
- X EXTENSIONSRC = $(TOP)/extensions
- X
- X DEPEXTENSIONLIB = $(EXTENSIONSRC)/lib/libXext.a
- X EXTENSIONLIB = $(DEPEXTENSIONLIB)
- X
- X DEPXLIB = $(DEPEXTENSIONLIB)
- X XLIB = $(EXTENSIONLIB) -L$(XLIBSRC) -lX11
- X
- X DEPXAUTHLIB = $(XAUTHSRC)/libXau.a
- X XAUTHLIB = $(DEPXAUTHLIB)
- X
- X DEPXMULIB =
- X XMULIB = -L$(XMUSRC) -lXmu
- X
- X DEPOLDXLIB =
- X OLDXLIB = -L$(OLDXLIBSRC) -loldX
- X
- X DEPXTOOLLIB =
- X XTOOLLIB = -L$(TOOLKITSRC) -lXt
- X
- X DEPXAWLIB =
- X XAWLIB = -L$(AWIDGETSRC) -lXaw
- X
- X LINTEXTENSIONLIB = $(EXTENSIONSRC)/lib/llib-lXext.ln
- X LINTXLIB = $(XLIBSRC)/llib-lX11.ln
- X LINTXMU = $(XMUSRC)/llib-lXmu.ln
- X LINTXTOOL = $(TOOLKITSRC)/llib-lXt.ln
- X LINTXAW = $(AWIDGETSRC)/llib-lXaw.ln
- X
- X DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
- X
- X DEPLIBS1 = $(DEPLIBS)
- X DEPLIBS2 = $(DEPLIBS)
- X DEPLIBS3 = $(DEPLIBS)
- X
- X USRINCDIR = $(DESTDIR)/usr/include
- X TESTSRC = $(TOP)/tests
- X MTOOLKITSRC = $(LIBSRC)/Xt
- X MWIDGETSRC = $(LIBSRC)/Xm
- X MRESOURCESRC = $(LIBSRC)/Mrm
- X UILSRC = $(CLIENTSRC)/uil
- X UIL = $(UILSRC)/uil
- X XMTOOLLIB = $(MTOOLKITSRC)/libXt.a
- X XMLIB = $(MWIDGETSRC)/libXm.a
- X MRESOURCELIB = $(MRESOURCESRC)/libMrm.a
- X UILLIB = $(UILSRC)/libUil.a
- X LINTMRESOURCE = $(MRESOURCESRC)/libMrm.a
- LINTXMWIDGETLIB = $(MWIDGETSRC)/llib-l/Xm.ln
- X LINTXMTOOL = $(MTOOLKITSRC)/llib-lXt.ln
- X LINTUILLIB = $(UILSRC)/llib-lUil.ln
- X
- ###########################################################################
- # Imake rules for building libraries, programs, scripts, and data files
- # rules: $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $
- X
- ###########################################################################
- # start of Imakefile
- X
- ###############################################################
- # Imakefile for XFBROWS
- ###############################################################
- # Possible flags are : -DSVR4 -Di386 -DSCO
- # and : -DNOTIMER -DUSLEEP (see Makefile.mk)
- ###############################################################
- X
- DEFINES = -DNOTIMER
- INCLUDES = -I$(TOP) -I$(TOP)/X11
- DEPLIBS = $(DEPXTOOLLIB) $(DEPXMULIB) $(DEPXLIB)
- LOCAL_LIBRARIES = $(XTOOLLIB) $(XMULIB) $(XLIB)
- X
- SRCS = butt.c dialog.c dir.c list.c misc.c scrl.c xfbrows.c
- OBJS = butt.o dialog.o dir.o list.o misc.o scrl.o xfbrows.o
- X
- X PROGRAM = xfbrows
- X
- all:: xfbrows
- X
- xfbrows: $(OBJS) $(DEPLIBS)
- X $(RM) $@
- X $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
- X
- saber_xfbrows:
- X #load $(ALLDEFINES) $(SRCS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
- X
- osaber_xfbrows:
- X #load $(ALLDEFINES) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
- X
- install:: xfbrows
- X $(INSTALL) -c $(INSTPGMFLAGS) xfbrows $(BINDIR)
- X
- install.man:: xfbrows.man
- X $(INSTALL) -c $(INSTMANFLAGS) xfbrows.man $(MANDIR)/xfbrows.n
- X
- depend:: $(DEPEND)
- X
- $(DEPEND):
- X @echo "checking $@ over in $(DEPENDSRC) first..."; \
- X cd $(DEPENDSRC); $(MAKE); \
- X echo "okay, continuing in $(CURRENT_DIR)"
- X
- depend::
- X $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
- X
- lint:
- X $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
- lint1:
- X $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
- X
- clean::
- X $(RM) $(PROGRAM)
- X
- ###########################################################################
- # common rules for all Makefiles - do not edit
- X
- emptyrule::
- X
- clean::
- X $(RM_CMD) \#*
- X
- Makefile:: $(IMAKE)
- X
- $(IMAKE):
- X @(cd $(IMAKESRC); if [ -f Makefile ]; then \
- X echo "checking $@ in $(IMAKESRC) first..."; $(MAKE) all; else \
- X echo "bootstrapping $@ from Makefile.ini in $(IMAKESRC) first..."; \
- X $(MAKE) -f Makefile.ini BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS); fi; \
- X echo "okay, continuing in $(CURRENT_DIR)")
- X
- Makefile::
- X -@if [ -f Makefile ]; then \
- X echo " $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
- X $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
- X else exit 0; fi
- X $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
- X
- tags::
- X $(TAGS) -w *.[ch]
- X $(TAGS) -xw *.[ch] > TAGS
- X
- saber:
- X #load $(ALLDEFINES) $(SRCS)
- X
- osaber:
- X #load $(ALLDEFINES) $(OBJS)
- X
- ###########################################################################
- # empty rules for directories that do not have SUBDIRS - do not edit
- X
- install::
- X @echo "install in $(CURRENT_DIR) done"
- X
- install.man::
- X @echo "install.man in $(CURRENT_DIR) done"
- X
- Makefiles::
- X
- includes::
- X
- ###########################################################################
- # dependencies generated by makedepend
- X
- SHAR_EOF
- chmod 0644 Makefile ||
- echo 'restore of Makefile failed'
- Wc_c="`wc -c < 'Makefile'`"
- test 10759 -eq "$Wc_c" ||
- echo 'Makefile: original size 10759, current size' "$Wc_c"
- fi
- # ============= Makefile.mk ==============
- if test -f 'Makefile.mk' -a X"$1" != X"-c"; then
- echo 'x - skipping Makefile.mk (File already exists)'
- else
- echo 'x - extracting Makefile.mk (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'Makefile.mk' &&
- # Makefile for xfile
- ###############################################################
- X
- # your C compiler of choice
- CC = gcc
- LIBS = -lX11 -linet
- PRG = xfbrows
- X
- ###############################################################
- # Possible flags are : -DSVR4 -Di386 -DSCO
- # and : -DNOTIMER -DUSLEEP
- ###############################################################
- X
- ###############################################################
- # For SYSV :
- FLAGS = -DSVR4 -DNOTIMER
- ###############################################################
- # For BSD :
- # FLAGS = -DNOTIMER
- ###############################################################
- # For A/UX :
- # FLAGS = -DNOTIMER
- ###############################################################
- # For SCO :
- # FLAGS = -DSCO -DNOTIMER
- ###############################################################
- X
- CFLAGS = -O $(FLAGS)
- OBJS = butt.o dialog.o dir.o list.o misc.o scrl.o xfbrows.o
- X
- .c.o: ; $(CC) -c $(CFLAGS) $*.c -o $@
- X
- all: $(PRG)
- X
- xfbrows: $(OBJS)
- X $(CC) $(CFLAGS) -o $(PRG) $(OBJS) $(LIBS)
- X strip $(PRG)
- X
- $(OBJS): xfbrows.h
- ctrl.o: bitmaps.h
- scrl.o: bitmaps.h
- butt.o: bitmaps.h
- X
- SHAR_EOF
- chmod 0644 Makefile.mk ||
- echo 'restore of Makefile.mk failed'
- Wc_c="`wc -c < 'Makefile.mk'`"
- test 1120 -eq "$Wc_c" ||
- echo 'Makefile.mk: original size 1120, current size' "$Wc_c"
- fi
- # ============= Imakefile ==============
- if test -f 'Imakefile' -a X"$1" != X"-c"; then
- echo 'x - skipping Imakefile (File already exists)'
- else
- echo 'x - extracting Imakefile (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'Imakefile' &&
- #ifdef BandAidCompiler
- #include BandAidCompiler
- #endif
- X
- ###############################################################
- # Imakefile for XFBROWS
- ###############################################################
- # Possible flags are : -DSVR4 -Di386 -DSCO
- # and : -DNOTIMER -DUSLEEP (see Makefile.mk)
- ###############################################################
- X
- DEFINES = -DNOTIMER
- INCLUDES = -I$(TOP) -I$(TOP)/X11
- DEPLIBS = $(DEPXTOOLLIB) $(DEPXMULIB) $(DEPXLIB)
- LOCAL_LIBRARIES = $(XTOOLLIB) $(XMULIB) $(XLIB)
- X
- SRCS = butt.c dialog.c dir.c list.c misc.c scrl.c xfbrows.c
- OBJS = butt.o dialog.o dir.o list.o misc.o scrl.o xfbrows.o
- X
- ComplexProgramTarget(xfbrows)
- X
- SHAR_EOF
- chmod 0600 Imakefile ||
- echo 'restore of Imakefile failed'
- Wc_c="`wc -c < 'Imakefile'`"
- test 679 -eq "$Wc_c" ||
- echo 'Imakefile: original size 679, current size' "$Wc_c"
- fi
- # ============= XFBROWS.AD ==============
- if test -f 'XFBROWS.AD' -a X"$1" != X"-c"; then
- echo 'x - skipping XFBROWS.AD (File already exists)'
- else
- echo 'x - extracting XFBROWS.AD (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'XFBROWS.AD' &&
- X
- xbrows*geometry: -10-10
- xbrows*icongeom: +700+10
- xbrows*foreground: black
- xbrows*background: white
- xbrows*borderwidth: 2
- xbrows*iconic: false
- X
- SHAR_EOF
- chmod 0644 XFBROWS.AD ||
- echo 'restore of XFBROWS.AD failed'
- Wc_c="`wc -c < 'XFBROWS.AD'`"
- test 151 -eq "$Wc_c" ||
- echo 'XFBROWS.AD: original size 151, current size' "$Wc_c"
- fi
- # ============= bitmaps.h ==============
- if test -f 'bitmaps.h' -a X"$1" != X"-c"; then
- echo 'x - skipping bitmaps.h (File already exists)'
- else
- echo 'x - extracting bitmaps.h (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'bitmaps.h' &&
- X
- #define down_width 16
- #define down_height 16
- static char down_bits[] =
- {
- X 0xff, 0xff, 0x01, 0x80, 0x01, 0x80, 0xf1, 0x87, 0x11, 0x84, 0x11, 0x84,
- X 0x11, 0x84, 0x1f, 0xbc, 0x05, 0x90, 0x09, 0x88, 0x11, 0x84, 0x21, 0x82,
- X 0x41, 0x81, 0x81, 0x80, 0x01, 0x80, 0xff, 0xff
- };
- X
- #define down1_width 16
- #define down1_height 16
- static char down1_bits[] =
- {
- X 0xff, 0xff, 0x01, 0x80, 0x01, 0x80, 0xf1, 0x87, 0xf1, 0x87, 0xf1, 0x87,
- X 0xf1, 0x87, 0xff, 0xbf, 0xfd, 0x9f, 0xf9, 0x8f, 0xf1, 0x87, 0xe1, 0x83,
- X 0xc1, 0x81, 0x81, 0x80, 0x01, 0x80, 0xff, 0xff
- };
- X
- #define up_width 16
- #define up_height 16
- static char up_bits[] =
- {
- X 0xff, 0xff, 0x01, 0x80, 0x81, 0x80, 0x41, 0x81, 0x21, 0x82, 0x11, 0x84,
- X 0x09, 0x88, 0x05, 0x90, 0x1f, 0xbc, 0x11, 0x84, 0x11, 0x84, 0x11, 0x84,
- X 0xf1, 0x87, 0x01, 0x80, 0x01, 0x80, 0xff, 0xff
- };
- X
- #define up1_width 16
- #define up1_height 16
- static char up1_bits[] =
- {
- X 0xff, 0xff, 0x01, 0x80, 0x81, 0x80, 0xc1, 0x81, 0xe1, 0x83, 0xf1, 0x87,
- X 0xf9, 0x8f, 0xfd, 0x9f, 0xff, 0xbf, 0xf1, 0x87, 0xf1, 0x87, 0xf1, 0x87,
- X 0xf1, 0x87, 0x01, 0x80, 0x01, 0x80, 0xff, 0xff
- };
- X
- #define scrlgray_width 8
- #define scrlgray_height 8
- static char scrlgray_bits[] =
- {
- X 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44
- };
- X
- #define gray50_width 8
- #define gray50_height 8
- static char gray50_bits[] =
- {
- X 0x33, 0xcc, 0x33, 0xcc, 0x33, 0xcc, 0x33, 0xcc
- };
- X
- SHAR_EOF
- chmod 0644 bitmaps.h ||
- echo 'restore of bitmaps.h failed'
- Wc_c="`wc -c < 'bitmaps.h'`"
- test 1371 -eq "$Wc_c" ||
- echo 'bitmaps.h: original size 1371, current size' "$Wc_c"
- fi
- # ============= xfbrows.h ==============
- if test -f 'xfbrows.h' -a X"$1" != X"-c"; then
- echo 'x - skipping xfbrows.h (File already exists)'
- else
- echo 'x - extracting xfbrows.h (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xfbrows.h' &&
- X
- #define REVDATE "Rev: 01/07/91"
- X
- #include <stdio.h>
- #include <math.h>
- #include <ctype.h>
- #include <string.h>
- extern int errno;
- extern char *sys_errlist[];
- X
- /* neither IBM AOS 4.3, Convex, nor BSD 4.3 on VAX have <malloc.h> */
- #if !defined(ibm032) && !defined(__convexc__) && \
- X !(defined(vax) && !defined(ultrix))
- #if defined(hp300) || defined(hp800)
- #include <sys/malloc.h>
- #else
- #include <malloc.h>
- #endif
- #endif
- X
- #include <X11/Xos.h>
- #include <X11/Xlib.h>
- #include <X11/Xutil.h>
- #include <X11/cursorfont.h>
- #include <X11/keysym.h>
- X
- #if defined(NEEDSTIME) || defined(NEEDSDIR)
- #include <sys/types.h>
- #endif
- X
- #ifdef NEEDSTIME
- #include <sys/time.h>
- #include <signal.h>
- #if defined(SCO) && !defined(NOTIMER)
- #include <sys/itimer.h>
- #endif
- #ifndef sigmask
- #define sigmask(m) (1 << ((m)-1))
- #endif
- #endif
- X
- #ifdef SVR4
- #define HOLD_SIG sighold(SIGALRM)
- #define RELEASE_SIG sigrelse(SIGALRM)
- #define PAUSE_SIG sigpause(SIGALRM)
- #else
- #define HOLD_SIG sigblock(sigmask(SIGALRM))
- #define RELEASE_SIG sigblock(0)
- #define PAUSE_SIG sigpause(0)
- #endif
- X
- #ifdef i386
- #undef HOLD_SIG
- #define HOLD_SIG
- #undef RELEASE_SIG
- #define RELEASE_SIG
- #undef PAUSE_SIG
- #define PAUSE_SIG
- #endif
- X
- #ifndef MAXPATHLEN
- #define MAXPATHLEN 512
- #endif
- X
- #define PROGNAME "xfbrows"
- #define DEFDIRGEOM "-10-10"
- X
- #define DIRWIDE 600
- #define DIRHIGH 270
- X
- #define S_NBUTTS 2
- #define S_BOPTI 0
- #define S_BQUIT 1
- X
- #define S_SBUTTS 2
- #define S_SOK 0
- #define S_SCANCEL 1
- X
- #define C_FIFO 'f'
- #define C_CHR 'c'
- #define C_DIR 'd'
- #define C_BLK 'b'
- #define C_LNK 'l'
- #define C_SOCK 's'
- #define C_REG ' '
- X
- #define NLINES 12
- #define BUTTW 60
- #define BUTTH 19
- X
- #define SPACING 3
- #define ASCENT (cfinfo->ascent)
- #define DESCENT (cfinfo->descent)
- #define CHIGH (ASCENT + DESCENT)
- #define LINEHIGH (CHIGH + SPACING)
- X
- #define STDINSTR "<stdin>"
- X
- #ifndef MAIN
- #define WHERE extern
- #else
- #define WHERE
- #endif
- X
- typedef struct
- {
- X Window win;
- X int len;
- X int vert;
- X int active;
- X int min, max;
- X int val;
- X int page;
- X int tpos;
- X int tmin, tmax;
- X int tsize;
- X unsigned long fg, bg;
- X void (*drawobj)();
- X int uplit, dnlit;
- } SCRL;
- X
- typedef struct
- {
- X Window win;
- X int x, y, w, h;
- X int lit;
- X int active;
- X int toggle;
- X unsigned long fg, bg;
- X char *str;
- } BUTT;
- X
- typedef struct
- {
- X Window win;
- X int x, y, w, h;
- X unsigned long fg, bg;
- X char **str;
- X int nstr;
- X int selected;
- X int nlines;
- X SCRL scrl;
- X int filetypes;
- X int dirsonly;
- } LIST;
- X
- #define CENTERX(f,x,str) ((x)-XTextWidth(f,str,strlen(str))/2)
- #define CENTERY(f,y) ((y)-((f->ascent+f->descent)/2)+f->ascent)
- #define RANGE(a,b,c) { if (a<b) a=b; if (a>c) a=c; }
- #define PTINRECT(x,y,rx,ry,rw,rh) \
- X ((x)>=(rx) && (y)>=(ry) && (x)<=(rx)+(rw) && (y)<=(ry)+(rh))
- X
- WHERE Display *theDisp;
- WHERE int theScreen;
- WHERE unsigned int ncells, dispWIDE, dispHIGH, dispDEEP;
- WHERE Colormap theCmap;
- WHERE Window rootW;
- WHERE GC theGC;
- WHERE unsigned long black, white, fg, bg, infofg, infobg;
- WHERE Font mfont, bfont, disfont;
- WHERE XFontStruct *mfinfo, *bfinfo, *cfinfo, *disfinfo;
- WHERE Visual *theVisual;
- WHERE Cursor arrow, target, hand;
- X
- WHERE char *cmd;
- WHERE int mono;
- X
- WHERE int ncols;
- WHERE int bwidth;
- X
- WHERE int numnames, curname;
- WHERE Pixmap grayTile, grayStip;
- X
- WHERE Window dirW, dnamW;
- WHERE LIST dList;
- WHERE BUTT dbut[S_NBUTTS], sbut[S_SBUTTS];
- WHERE char **dirnames;
- X
- WHERE Window diaW, disW;
- X
- WHERE int iconic;
- WHERE char *icongeom;
- X
- #undef WHERE
- X
- Window CreateWindow();
- int StringWidth();
- void SetBold (), SetNormal (), ExposureWin (), Timer(), FatalError(), Quit();
- X
- void LSCreate(), LSRedraw(), LSNewData();
- int LSClick();
- X
- void CreateDirW(), RedrawDirW(), LoadCurrentDirectory();
- int ClickDirW(), DirKey();
- void DoDisplay ();
- void RedrawDDirW(), RedrawDNamW(), SelectDir(), TrackDDirW();
- void SetDirFName(), SetTypeName();
- X
- void SCCreate(), SCSetRange(), SCSetVal(), SCRedraw(), SCTrack();
- X
- void BTCreate(), BTSetActive(), BTRedraw(); int BTTrack();
- X
- void CreateDisW (), RedrawDisW (); int DisplayEventLoop ();
- void CreateErrW (), RedrawErrW (); int ErrorEventLoop ();
- X
- void SetFonts ();
- X
- SHAR_EOF
- chmod 0644 xfbrows.h ||
- echo 'restore of xfbrows.h failed'
- Wc_c="`wc -c < 'xfbrows.h'`"
- test 4110 -eq "$Wc_c" ||
- echo 'xfbrows.h: original size 4110, current size' "$Wc_c"
- fi
- # ============= xfbrows.man ==============
- if test -f 'xfbrows.man' -a X"$1" != X"-c"; then
- echo 'x - skipping xfbrows.man (File already exists)'
- else
- echo 'x - extracting xfbrows.man (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xfbrows.man' &&
- .TH XFBROWS 1 "1 July 1991" "X Version 11"
- .SH NAME
- xfbrows - X11 font browser
- .SH SYNOPSIS
- .B xfbrows
- .B [
- [-display disp] [-iconic]
- .br
- X [-geometry geom] [-icongeom geom]
- .br
- X [-bg background] [-fg foreground] [-bw width]
- .B ]
- .SH DESCRIPTION
- .I Xfbrows
- is a simple font browser for X11.
- .PP
- When the window opens, it will display all fonts the server knows
- in a scrollable list.
- X
- Simply click a fontname (or type one in, with wildcard too) and a window will
- come up showing you the font. Click the OK-Button to leave this window.
- X
- Click the QUIT-Button to leave the application.
- .SH OPTIONS
- .I Xfbrows
- accepts all X Toolkit command line options listed below:
- .PP
- .TP 12
- .B -display
- Sets the display to the specified name (Resource name: display, Type: string,
- Default: none).
- .TP 12
- .B -geometry
- Specifies the
- .I xfbrows
- position on the screen. You can't resize the window
- (Resource name: geometry, Type: string, Default: none).
- .TP 12
- .B -icongeom
- Specifies the
- .I xfbrows
- icon position on the screen. Only positive values are excepted, because
- the size of the icon depends on the window manager
- (Resource name: icongeom, Type: string, Default: none).
- .TP 12
- .B -fg
- Sets the foreground color for the windows (Resource name: foreground,
- Type: color, Default: black).
- .TP 12
- .B -bg
- Sets the background color for the windows (Resource name: background,
- Type: color, Default: white).
- .TP 12
- .B -bw
- Specifies the border width for the windows (Resource name: borderwidth,
- Type: digit, Default: 2).
- .TP 12
- .B -iconic
- Specifies that
- .I xfbrows
- should start up iconified (Resource name: iconic, Type: boolean,
- Default: false).
- .SH DIAGNOSTICS
- .I Xfbrows
- exits with EOF (-1) if a fatal error occurs, otherwise with zero (0).
- If an error occurs during an action, a error window is coming up explaining
- the error. Click the OK-Button to continue (selected or specified fontnames
- are then deselected).
- .SH AUTHOR
- .I Phade Software
- .br
- Inh. Frank Gadegast
- .br
- Schierker Str. 39
- .br
- 1000 Berlin 44 GERMANY
- .PP
- Copyright (c) 1991, Phade Software
- .PP
- phade@cs.tu-berlin.de
- .SH BUGS
- The thumb maybe doesn't works right with colors.
- SHAR_EOF
- chmod 0644 xfbrows.man ||
- echo 'restore of xfbrows.man failed'
- Wc_c="`wc -c < 'xfbrows.man'`"
- test 2132 -eq "$Wc_c" ||
- echo 'xfbrows.man: original size 2132, current size' "$Wc_c"
- fi
- exit 0
-
- --
- Dan Heller
- O'Reilly && Associates Z-Code Software Comp-sources-x:
- Senior Writer President comp-sources-x@uunet.uu.net
- argv@ora.com argv@zipcode.com
-